package com.demo.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/resp")
public class RespController3 {
    /**
     * 演示请求重定向
     */
    @RequestMapping("/redirect")
    public String redirect(){
        System.out.println("redirect");
        return "redirect:http://www.baidu.com";
    }
    /**
     * 演示转发
     */
    @RequestMapping("/forward")
    public String forward(){
        System.out.println("forward");
        return "forward:/json/list";
    }
}
